/*
 * TileReader.h
 *
 *  Created on: 2009/01/29
 *      Author: Yongshik Cho
 */

#ifndef TILEREADER_H_
#define TILEREADER_H_

#include "../core/Prerequisites.h"
#include "../Tile.h"
#include "../Sprite.h"
#include <tinyxml.h>


class TileReader
{
public:
	static const std::string _NAME_TAG;
	static const std::string _PATH_TAG;
	static const std::string _X_COUNT_TAG;
	static const std::string _Y_COUNT_TAG;
	static const std::string _SAME_ANIMATION_TILE_TAG;
	static const std::string _SAME_TWEEN_TILE_TAG;
	static const std::string _TRANSPARENT_COLOR_TAG;
	static const std::string _BLENDTYPE_TAG;
	static const std::string _SORT_TAG;
	static const std::string _ORIGIN_TAG;
	static const std::string _UP_TAG;

	static const std::string _CENTERTYPE_TAG;
	static const std::string _FLIPTYPE_TAG;
	static const std::string _COLLIDETYPE_TAG;
	static const std::string _BLENDCOLOR_TAG;
	static const std::string _LOCKED_TAG;
	static const std::string _VISIBLE_RECT_TAG;
	static const std::string _VISIBLE_CENTER_TAG;
	static const std::string _VISIBLE_TAG;

	static const std::string _CENTER_LT_TAG;
	static const std::string _CENTER_CT_TAG;
	static const std::string _CENTER_RT_TAG;
	static const std::string _CENTER_LM_TAG;
	static const std::string _CENTER_CM_TAG;
	static const std::string _CENTER_RM_TAG;
	static const std::string _CENTER_LB_TAG;
	static const std::string _CENTER_CB_TAG;
	static const std::string _CENTER_RB_TAG;

	static const std::string _FLIP_NONE_TAG;
	static const std::string _FLIP_LEFTRIGHT_TAG;
	static const std::string _FLIP_TOPBOTTOM_TAG;

	static const std::string _COLLIDABLE_PIXEL_TAG;
	static const std::string _COLLIDABLE_LINE_TAG;
	static const std::string _COLLIDABLE_TRIANGLE_TAG;
	static const std::string _COLLIDABLE_RECT_TAG;
	static const std::string _COLLIDABLE_POLYGON_TAG;

	static const std::string _TRUE_TAG;
	static const std::string _FALSE_TAG;

	static const std::string _TWEEN_TAG;
	static const std::string _POSITION_TAG;
	static const std::string _ROTATION_TAG;
	static const std::string _ANGLE_TAG;
	static const std::string _SCALE_TAG;
	static const std::string _ANIMATION_TAG;
	static const std::string _COLLISION_TAG;
	static const std::string _X_TAG;
	static const std::string _Y_TAG;

	static const std::string _SCRIPT_FILE_TAG;
	static const std::string _ON_LOAD_TAG;

	static const std::string _ATTACHMENT_TAG;

	static const std::string _BLEND_NONE_TAG;
	static const std::string _BLEND_ALPHA_TAG;
	static const std::string _BLEND_ADD_TAG;
	static const std::string _BLEND_SUB_TAG;
	static const std::string _BLEND_DARKEN_TAG;
	static const std::string _BLEND_LIGHTEN_TAG;
	static const std::string _BLEND_MULTIPLY_TAG;
	static const std::string _BLEND_SCREEN_TAG;
	static const std::string _BLEND_DIFFERENCE_TAG;
	static const std::string _BLEND_INVERSE_DIFFERENCE_TAG;
	static const std::string _BLEND_INVERT_TAG;
	static const std::string _BLEND_DODGE_TAG;

public:
	static Tile* parse(TiXmlElement* element, RenderObjectContainer* roc);
	static void parseAttachment(TiXmlElement* element, Renderable* renderable);
	static void parseScripts(TiXmlElement* element, Tile* tile);
};

#endif /* TILEREADER_H_ */
